package models

import "gorm.io/gorm"

type Good struct {
	gorm.Model
	Phone       string `json:"Phone"`
	Password    string `json:"Password"`
	SendCode    string `json:"SendCode"`
	CaptchaCode string `json:"CaptchaCode"`
}

func (g *Good) GoodAdd(db *gorm.DB) error {

	return db.Debug().Create(g).Error

}

func (g *Good) GoodFind(db *gorm.DB, phone string) error {

	return db.Debug().Where("phone=?", phone).Find(g).Error

}

func (g *Good) GoodLogin(db *gorm.DB, phone string) error {

	return db.Debug().Where("phone=?", phone).Find(g).Error

}
